home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 027a / seekfi.zip / SEEKTEST.PRG < prev   
Text File  |  1991-07-11  |  674b  |  34 lines

  1. /* #include "seekfix.ch" */
  2.  
  3. procedure Main
  4.   field Name
  5.   set deleted on
  6.   if !file("Test.dbf")
  7.    dbcreate("Test",{{"Name","C",10,0}})
  8.    use Test new
  9.    append blank
  10.    index on Name to Test
  11.    close Test
  12.    use Test index Test shared
  13.    ? &(indexkey())
  14.    seek "CRAIG"
  15.    do while !found() .and. (nextkey() == 0)
  16.      ? "Not there yet..."
  17.      seek "CRAIG"
  18.    enddo
  19.    ? iif(nextkey()==0,"Found it...","Aborted...")
  20.    inkey(3)
  21.    CLOSE Test
  22.    delete file test.dbf
  23.    delete file test.ntx
  24. else
  25.    use Test index Test shared
  26.    if rlock()
  27.      Test->Name := "CRAIG"
  28.    else
  29.      ? "Unable to lock..."
  30.    endif
  31.    close Test
  32. endif
  33. return
  34.